# include <bits/stdc++.h>
using namespace std;
int n, r, i, j, a[11];
int main() { 
    cin >> n >> r;
    i = 1, a[1] = n;
    do{ 
        if(a[i] > r - i){ //符合条件
            if(i == r) { //输出
                for(j = 1; j <= r; j++) printf("%3d\n", a[j]);
                a[i]--;
            }
        } else { //继续搜索 
            a[i + 1] = a[i] - 1;
            i++;
        }
    } while(a[1] != r-1);
}
